// 2025/5/25
// 小红的子串

#include <iostream>
#include <string>
#include <unordered_map>
using namespace std;

long long atMostK(const string& s, int k) {
    unordered_map<char, int> count;
    int left = 0;
    long long res = 0;
    int distinct = 0;
    for (int right = 0; right < s.size(); ++right) {
        char c = s[right];
        if (count[c] == 0) {
            distinct++;
        }
        count[c]++;
        while (distinct > k) {
            char leftChar = s[left];
            count[leftChar]--;
            if (count[leftChar] == 0) {
                distinct--;
            }
            left++;
        }
        res += right - left + 1;
    }
    return res;
}

int main() {
    int n, l, r;
    cin >> n >> l >> r;
    string s;
    cin >> s;
    
    // 处理 l=0 的情况（如果题目允许）
    long long ans;
    if (l == 0) {
        ans = atMostK(s, r);
    } else {
        ans = atMostK(s, r) - atMostK(s, l - 1);
    }
    cout << ans << endl;
    return 0;
}